<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       Cake.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

$cakeDescription = __d('LeagueofLegendsIcon', 'Portal LOL');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>:
                
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon', '/portallol/favicon.ico', array('type'=>'icon'));
                

		echo $this->Html->css('default');
		echo $this->Html->css('home');
		echo $this->Html->css('post');
		

                echo $this->Html->script('ckeditor/ckeditor.js');
                echo $this->Html->script('ckfinder/ckfinder.js');
    
   

		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>
<body>

	<div id="logo">
			
	</div>
	
	<div id="container">
		
		<div id="header">
		</div>
		<div id="menu">
		
			<div class="login">
				<div class="login_content">
					<?php

					
					if($isLoged){
                                                if($isAdmin)
                                                    $string=$this->Html->link('Edit', array('controller'=>'users','action' => 'index'));
                                                else
                                                    $string=$this->Html->link('Edit', array('controller'=>'users','action' => 'edit',$userId));
						echo '<p>Logado: '.$userName.'</p>';
						echo $this->Html->link('Logout', array('controller'=>'users','action' => 'logout')); 
                                                echo ' '.$string; 
					}
					else{
						?>
						<?php echo $this->Form->create('User',array('action' => 'login'));?>
						<fieldset>
							<legend><?php echo __('Por favor, entre com o seu nome de usuário e a senha'); ?></legend>
							<?php
								echo $this->Form->input('username',array('label' => 'Usuário'));
								echo $this->Form->input('password',array('label' => 'Senha'));
							?>
						</fieldset>
						<?php echo $this->Form->end(__('Login'));
						echo $this->Html->link('Não é cadastrado?', array('controller'=>'users','action' => 'add'));
			
					}
						?>
				</div>
			</div>
		
			<div class="clear"></div>
			<ul>
				<!-- <li><?php echo $this->Html->link('Add Post', array('controller'=>'posts', 'action' => 'add')); ?></li> -->
				<li><?php echo $this->Html->link('Home', array('controller'=>'homes','action' => 'index')); ?></li>
				<!--<li><?php echo $this->Html->link('Inserir Imagem', array('controller'=> 'images', 'action' => 'add')); ?></li> -->
				<li><?php echo $this->Html->link('Tutoriais', array('controller'=>'tutorials','action' => 'index')); ?></li>
				<li><?php echo $this->Html->link('Post', array('controller'=>'posts','action' => 'index')); ?></li>
				<li><?php echo $this->Html->link('Champions', array('controller'=>'champions','action' => 'index')); ?></li>
				<li><?php echo $this->Html->link('Itens', array('controller'=>'items','action' => 'index')); ?></li>
				<li><?php echo $this->Html->link('Game Play', array('controller'=>'videos','action' => 'index')); ?></li>
				
				<?php
					if($isAdmin){
						echo '<li>'.$this->Html->link('Usuários', array('controller'=>'users','action' => 'index')).'</li>';
					}
						
				?>
				
			</ul>

		</div>
                
		<div id="content">
			<div id="text">
				<?php echo $this->Session->flash(); ?>
                                <?php echo $this->Session->flash('auth'); ?>
				<?php echo $this->fetch('content'); ?>
			</div>
		</div>
		
		<div class="clear">
		
		<div id="footer">
			<?php echo $this->Html->link(
					$this->Html->image('LeagueofLegends.png', array('alt' => $cakeDescription, 'border' => '0','width' => '150', 'heigth'=> '200')),
					'http://na.leagueoflegends.com/',
					array('escape' => false)
				);
			?>
		</div>
	</div>
	
</body>
</html>
